# 需要使用路径名来获取文件名，目录名，绝对路径等等

import os
path = 'E:\\库\\Documents\\a.txt'

# Get the last component of the path
print(os.path.basename(path))

# Get the directory name
print(os.path.dirname(path))

# Join path components together
print(os.path.join('path1', 'path2', os.path.basename(path)))

# Expand the user's home directory
print(os.path.expanduser('~\Data\data.csv'))

# Split the file extension
print(os.path.splitext(path))
